<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>短剧详情</title>
    <script src="./js/ajax.js"></script>
    <style>
        .player {
            box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
            padding: 10px;
        }

        .player video {
            width: 200px;
        }
    </style>
</head>

<body>
    <h1>短剧详情</h1>
    <div class="player"></div>
    <script>
        // 获取查询字符串参数
        var eid = location.search.slice(5)
        var player=document.querySelector('.player')
        ajax({
            url: 'http://playlet.zonelian.com:5501/api/playlet/auth',
            method: 'POST',
            // 请求参数: 请求体
            data: {
                eid: eid,
                zlsj: 'zlsj'
            },
            success: function (res) {
                // 动态创建video
                var video=document.createElement('video')
                video.src=res.data.url
                video.controls='controls'
                // 将video标签显示到浏览器中
                player.appendChild(video)
            }
        })
    </script>
</body>

</html>